import java.util.*;
public class t11291 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int ch;
        for(int q=0;q<a;q++){
            //System.out.println(a);
        String b=new String();
        b=in.next();
        int n=b.length();
        //System.out.println(n);
        int co0=0;
        int co1=0;
        for(int i=0;i<n;i++){
            if(b.charAt(i)=='0')
                co0++;
            else co1++;
        }
        if(co0==co1){
            if(co0%2==1){
                System.out.println("DA");
            }else System.out.println("NET");
        }else {
            if(co0<co1){
                if(co0%2==0){
                    System.out.println("NET");
                }else System.out.println("DA");
            }else {
                if(co1%2==0){
                    System.out.println("NET");
                }else System.out.println("DA");
            }
        }
        //System.out.println(co1+co0);
        }
        
        
    }
}
